#include <cstdlib>
#include <cstdio>
#include <stack>
#include <cstring>

using namespace std;
stack<double> OPND; //操作数栈
stack<char> OPER; // 操作符栈

// 双目运算
double calculate(char oper) {
    double a = OPND.top(), b;
    OPND.pop();
    b = OPND.top();
    OPND.pop();
    switch (oper) {
        case '+':
            return b + a;
        case '-':
            return b - a;
        case '*':
            return b * a;
        case '/':
            return b / a;
    }
}

int main() {
    int len, i; // 计数器，数字转换时记录小数位数
    double num;
    char s[210], oper;
    while (gets(s)) { // 读入第一行表达式
        len = strlen(s);
        if (len == 1 && s[0] == '0')
            break;
        i = 0;
        while (i < len) {
            num = 0;
            while (s[i] == ' ')
                i++;
            // 将数字由字符型转化为整形
            while (((s[i] >= '0' && s[i] <= '9') || s[i] == '.') && i < len) {
                num = num * 10 + s[i] - '0';
                i++;
            }
            OPND.push(num);
            while (s[i] == ' ')
                i++;
            switch (s[i]) {
                // 优先级最低
                case '+':
                case '-':
                    while (!OPER.empty()) {
                        oper = OPER.top();
                        OPER.pop();
                        OPND.push(calculate(oper));
                    }
                    OPER.push(s[i]);
                    break;
                case '*':
                case '/':
                    while (!OPER.empty() && (OPER.top() == '*' || OPER.top() == '/')) {
                        oper = OPER.top();
                        OPER.pop();
                        OPND.push(calculate(oper));
                    }
                    OPER.push(s[i]);
                    break;
                default:
                    break;
            }
            i++;
        }
        while (!OPER.empty()) {
            oper = OPER.top();
            OPER.pop();
            OPND.push(calculate(oper));
        }
        printf("%.2lf\n", OPND.top());
        OPND.pop();
    }
    return 0;
}